﻿using System;
using System.Linq;
using System.Web.WebPages;

namespace TM.Weixin.MP
{
    /// <summary>
    /// 配置显示模式
    /// </summary>
    public class DisplayConfig
    {
        public static void RegisterMode()
        {
            DisplayModeProvider.Instance.Modes.Insert(0, new DefaultDisplayMode("en_US")
            {
                ContextCondition = (context => context.Request.Cookies.AllKeys.Any(x => x.ToLower().IndexOf("en-us", StringComparison.OrdinalIgnoreCase) >= 0) && !context.GetOverriddenBrowser().IsMobileDevice)
            });
        }
    }
}